package com.ruoyi.shop.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopRestaurantMapper;
import com.ruoyi.shop.domain.ShopRestaurant;
import com.ruoyi.shop.service.IShopRestaurantService;

/**
 * 美食店铺Service业务层处理
 * 
 * @author yangye
 * @date 2025-07-25
 */
@Service
public class ShopRestaurantServiceImpl implements IShopRestaurantService 
{
    @Autowired
    private ShopRestaurantMapper shopRestaurantMapper;

    /**
     * 查询美食店铺
     * 
     * @param restaurantId 美食店铺主键
     * @return 美食店铺
     */
    @Override
    public ShopRestaurant selectShopRestaurantByRestaurantId(Long restaurantId)
    {
        return shopRestaurantMapper.selectShopRestaurantByRestaurantId(restaurantId);
    }

    /**
     * 查询美食店铺列表
     * 
     * @param shopRestaurant 美食店铺
     * @return 美食店铺
     */
    @Override
    public List<ShopRestaurant> selectShopRestaurantList(ShopRestaurant shopRestaurant)
    {
        return shopRestaurantMapper.selectShopRestaurantList(shopRestaurant);
    }

    /**
     * 新增美食店铺
     * 
     * @param shopRestaurant 美食店铺
     * @return 结果
     */
    @Override
    public int insertShopRestaurant(ShopRestaurant shopRestaurant)
    {
        shopRestaurant.setCreateTime(DateUtils.getNowDate());
        return shopRestaurantMapper.insertShopRestaurant(shopRestaurant);
    }

    /**
     * 修改美食店铺
     * 
     * @param shopRestaurant 美食店铺
     * @return 结果
     */
    @Override
    public int updateShopRestaurant(ShopRestaurant shopRestaurant)
    {
        shopRestaurant.setUpdateTime(DateUtils.getNowDate());
        return shopRestaurantMapper.updateShopRestaurant(shopRestaurant);
    }

    /**
     * 批量删除美食店铺
     * 
     * @param restaurantIds 需要删除的美食店铺主键
     * @return 结果
     */
    @Override
    public int deleteShopRestaurantByRestaurantIds(Long[] restaurantIds)
    {
        return shopRestaurantMapper.deleteShopRestaurantByRestaurantIds(restaurantIds);
    }

    /**
     * 删除美食店铺信息
     * 
     * @param restaurantId 美食店铺主键
     * @return 结果
     */
    @Override
    public int deleteShopRestaurantByRestaurantId(Long restaurantId)
    {
        return shopRestaurantMapper.deleteShopRestaurantByRestaurantId(restaurantId);
    }
}
